00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _linear_matrix_solver_implementation_hpp_
00021 #define _linear_matrix_solver_implementation_hpp_
00022
00023 #include "gridpack/parallel/distributed.hpp"
00024 #include "gridpack/configuration/configurable.hpp"
00025 #include "gridpack/utilities/uncopyable.hpp"
00026 #include "gridpack/math/linear_matrix_solver_interface.hpp"
00027
00028 namespace gridpack {
00029 namespace math {
00030
00031
00032
00033
00034
00035 template <typename T, typename I>
00036 class LinearMatrixSolverImplementation
00037 : public BaseLinearMatrixSolverInterface<T, I>,
00038 public parallel::Distributed,
00039 public utility::Configurable,
00040 private utility::Uncopyable
00041 {
00042 public:
00043
00044 typedef typename BaseLinearMatrixSolverInterface<T, I>::MatrixType MatrixType;
00045
00046
00047 LinearMatrixSolverImplementation(const MatrixType& A)
00048 : BaseLinearMatrixSolverInterface<T, I>(),
00049 parallel::Distributed(A.communicator()),
00050 utility::Configurable(),
00051 utility::Uncopyable(),
00052 p_A(A.clone())
00053 {
00054 configurationKey("LinearMatrixSolver");
00055 }
00056
00057
00058
00059 ~LinearMatrixSolverImplementation(void)
00060 {}
00061
00062
00063 MatrixType *solve(const MatrixType& B) const
00064 {
00065 return this->p_solve(B);
00066 }
00067
00068 protected:
00069
00070
00071 boost::scoped_ptr<MatrixType> p_A;
00072
00073
00074 virtual MatrixType *p_solve(const MatrixType& B) const = 0;
00075
00076 };
00077
00078
00079 }
00080 }
00081
00082
00083 #endif